package com.wx.wxapp.controller;


import com.wx.wxapp.entity.Label;
import com.wx.wxapp.service.LabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class LabelController {
    @Autowired
    private LabelService labelService;

    /*
     *   功能：获取热门标签
     *   参数：
     * */
    @RequestMapping(value = "/getHotFoodLabel",method = RequestMethod.GET)
    public List<String> GetHotFoodLabel(){
        return labelService.GetHotFoodLabel();
    }

    @RequestMapping(value = "/getHotDiseaseLabel",method = RequestMethod.GET)
    public List<String> GetHotDiseaseLabel(){
        return labelService.GetHotDiseaseLabel();
    }

    @RequestMapping(value = "/getCardsByLabel",method = RequestMethod.GET)
    public Map GetCardsByLabel(@RequestParam("label")String label,@RequestParam("pageNumber")int pageNumber,
                               @RequestParam("cardType")String cardType){
        System.out.println("cardtype is " + cardType);
        return labelService.GetCardsByLabel(label,pageNumber,cardType);
    }
}
